package com.hxkj.dao.impl;

import com.hxkj.dao.UserArticleDao;
import com.hxkj.mapper.UserArticleMapper;
import com.hxkj.domain.po.UserArticle;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-08-10 18:32:29
*
*/
@Service("userArticleDao")
public class UserArticleDaoImpl implements UserArticleDao {

    @Resource
    private UserArticleMapper userArticleMapper;

    @Override
    public UserArticle get(Long id) {
        return userArticleMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<UserArticle> get(UserArticle userArticle) {
        return userArticleMapper.select(userArticle);
    }

    @Override
    public int delete(Long id) {
        return userArticleMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int delete(UserArticle userArticle) {
        return userArticleMapper.delete(userArticle);
    }

    @Override
    public int save(UserArticle userArticle) {
        return userArticleMapper.insert(userArticle);
    }

    @Override
    public int update(UserArticle userArticle) {
        return userArticleMapper.update(userArticle);
    }

    @Override
    public UserArticle getByUser(UserArticle userArticle) {
        return userArticleMapper.getByUser(userArticle);
    }

    @Override
    public int ifCollectArticle(UserArticle userArticle) {
        return userArticleMapper.ifCollectArticle(userArticle);
    }
}
